def count_words(file):
    file = file.lower()
    count = 0
    for i in file:
        if i == " ":
            count += 1
    print (count + 1, "words")

def count_letters(file):
    file = file.lower()
    print (len(file), "letters")

def count_symbols(file):
    file = file.lower()
    count = 0
    nums = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '0']
    for i in file:
        if i.isalpha() == False:
            if i not in nums:
                count += 1
    print (count, "symbols")

def common_letters(file):
    file = file.lower()
    count1 = 0
    count2 = 0
    count3 = 0
    word1  = ""
    word2  = ""
    word3  = ""
    let_list = []
    for i in file:
        let_list.append(i)
    while ' ' in let_list:
        let_list.remove(' ')
    for i in let_list:
        let_count = let_list.count(i)
        while i in let_list:
            let_list.remove(i)
        if let_count > count1:
            count3 = count2
            count2 = count1
            count1 = let_count
            word3 = word2
            word2 = word1
            word1 = i
        elif let_count > count2:
            count3 = count2
            count2 = let_count
            word3 = word2
            word2 = i
        elif let_count > count3:
            count3 = let_count
            word3 = i
    print ("Top three most common letters:", word1, word2, word3)

def common_words(file):
    file = file.lower()
    letters = []
    words = []
    for i in file:
        if i != ' ':
            letters.append(i)
        else:
            words.append("".join(letters))
            letters = []
    count1 = 0
    count2 = 0
    count3 = 0
    word1  = ""
    word2  = ""
    word3  = ""
    for i in words:
        ind_count = words.count(i)
        while i in words:
            words.remove(i)
        if ind_count > count1:
            count3 = count2
            count2 = count1
            count1 = ind_count
            word3 = word2
            word2 = word1
            word1 = i
        elif ind_count > count2:
            count3 = count2
            count2 = ind_count
            word3 = word2
            word2 = i
        elif ind_count > count3:
            count3 = ind_count
            word3 = i
    print ("Top three most common words are:", word1, word2, word3)

def main():
    file = input("Input: ")
    count_words(file)
    count_letters(file)
    count_symbols(file)
    common_words(file)
    common_letters(file)

main()
